//权限校验代码
import { useRoute } from 'vue-router'

export const checkRouter = (key: string) => {
  const route = useRoute()
  if (route && route.meta.buttons) {
    const ishavePermission = route.meta.buttons.some(item => item === key)
    return ishavePermission
  }
  return false
}

//使用方法 导入
// import { checkRouter } from '@/util/checkRouter'
// v-if="checkRouter('权限代码')"
